<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<input type="hidden" name="id" value="${id}">
<input type="hidden" name="createTime" value="${createTime}">
<input type="hidden" name="createUser" value="${createUser}">
<table style="width: 100%;" class="listtable">
        <tr class="row-even">
            <td class="tr_left"><span class="required">*</span>类别名称:&nbsp;</td>
            <td class="tr_right">
                <input type="text" name="name" value="${name}" maxlength="200"  class="easyui-validatebox" data-options="required:true,missingMessage:'请输入类别名称'"/>
            </td>
        </tr>
        <tr>
            <td class="tr_left"><span class="required">*</span>船舱属性:&nbsp;</td>
            <td class="tr_right">
            	<input type="text" id="select_type" name="type" value="${type}"
                   class="easyui-combobox" data-options="
                   valueField: 'value',
                    editable:false,
					textField: 'label',
					onChange:function (newValue,oldValue) {
            			type(newValue);
            		},
					data: [{
						label: '住仓',
						value: '1'
					},{
						label: '非住仓',
						value: '2'
					}],required:true,missingMessage:'请选择船舱属性'"/>
            </td>
        </tr>
        <tr class="row-even" id="bnum">
            <td class="tr_left"><span class="required">*</span>可住人数:&nbsp;</td>
            <td class="tr_right">
                <input  id="badnum" name="badnum" value="${badnum}" maxlength="200"  class="easyui-validatebox" data-options="required:true,missingMessage:'请输入可住人数'"/>
            </td>
        </tr>
        <tr>
            <td class="tr_left"><span class="required">*</span>分配属性:&nbsp;</td>
            <td class="tr_right">
            	<input type="text" id="select_type" name="autoType" value="${autoType}"
                   class="easyui-combobox" data-options="
                   valueField: 'value',
                    editable:false,
					textField: 'label',
					
					data: [{
						label: '可自动分配',
						value: '1'
					},{
						label: '不可自动分配',
						value: '2'
					}],required:true,missingMessage:'请选择船舱分配属性'"/>
            </td>
        </tr>
    </table>
<script type="text/javascript"> 
	function type(val){
		if(val==1){
			$("#bnum").show();
			$("#badnum").val(${badnum});
		}else{
			$("#bnum").hide();
			$("#badnum").val(0);
		}
		if($("#badnum").val()==''){
			$("#badnum").val(0);
		}
	}
	type(${type});
</script>
